//-----------------------------------------------------------------------
// <copyright file="Device.h" company="Microsoft">
//      Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
// Module:
//      Device.h
//
// Description:
//      Device Class
//
//-----------------------------------------------------------------------


#pragma once

class CDevice
{
public:
    enum DeviceEvent
    {
        Undefined,
        ButtonNext,
        ButtonPrevious,
        ButtonUp,
        ButtonDown,
        ButtonSelect,
        ButtonMenu,
        ButtonBack,
        Initialize,
        RenderAgain
    };

    CDevice(void){}
    ~CDevice(void){}

    // Sets the device capabilities
    static HRESULT SetDeviceCaps(LPCWSTR pwszDeviceFriendlyName, // The friendly name of the device as seen in the SideShow Control Panel
                                 LPCWSTR pwszDeviceManufacturer, // The device manufacturer name as seen in device manager's details tab
                                 LPCWSTR pwszDeviceFirmwareVersion, // The driver version as seen in device manager's driver tab
                                 DWORD dwDeviceHorizontalResolution, // The horizontal resolution of the device
                                 DWORD dwDeviceVerticalResolution, // The vertical resolution of the device
                                 DWORD dwDeviceBitDepth, // The bit depth of the device
                                 BOOL  bTopDownBitmap = FALSE);

    // Releases memory used by DeviceCaps and resets all values to 0 / NULL
    static HRESULT ReleaseDeviceCaps(void);

    // DeviceCaps Accessors
    static bool     AreDeviceCapalitiesDefined(void) {return m_fDeviceCapabilitiesAreDefined;}
    static LPCWSTR  GetDeviceFriendlyName(void) {return m_pwszDeviceFriendlyName;}
    static LPCWSTR  GetDeviceManufacturer(void) {return m_pwszDeviceManufacturer;}
    static LPCWSTR  GetDeviceFirmwareVersion(void) {return m_pwszDeviceFirmwareVersion;}
    static DWORD    GetDeviceHorizontalResolution(void) {return m_dwDeviceHorizontalResolution;}
    static DWORD    GetDeviceVerticalResolution(void) {return m_dwDeviceVerticalResolution;}
    static DWORD    GetDeviceBitDepth(void) {return m_dwDeviceBitDepth;}
    static DWORD    IsTopDownBitmapRequired(void) {return m_bTopDownBitmap;}

    static HRESULT SendRenderedDataToDevice(const BYTE* pbBitmapData, DWORD cbBitmapData, DWORD dwRenderFlags);
    static HRESULT HandleDeviceEvent(const CDevice::DeviceEvent DeviceEvent); // Such as a Next or Previous button

private:
    // Device Capabilities Members
    static bool     m_fDeviceCapabilitiesAreDefined;
    static LPCWSTR  m_pwszDeviceFriendlyName;
    static LPCWSTR  m_pwszDeviceManufacturer;
    static LPCWSTR  m_pwszDeviceFirmwareVersion;
    static DWORD    m_dwDeviceHorizontalResolution;
    static DWORD    m_dwDeviceVerticalResolution;
    static DWORD    m_dwDeviceBitDepth;
    static BOOL     m_bTopDownBitmap;
};

